#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Time: 2019/11/23  19:14
# @Author: 余浪人
# @email: yulangren520@gmail.com
import random
from datetime import datetime
from flask import render_template, request
from apps.lib.cache_sys import sys_cache, cache
from apps.models.content_model import TL_Column_model, TL_Content_Model, TL_Tags_Model
from apps.models.system_model import TL_Blogroll_Model, TL_Notice_Model
from apps.webapi.webpublic.public import ipAdd, nav_list, content, page_auto, notNull, img
from apps.webapp import webapp_bp, render_theme, Authority
from apps.lib.public import check_obj, visiting_user
@webapp_bp .route ('/',endpoint ='index_page',methods =['GET'])
@Authority
@ipAdd
@visiting_user
@cache .cached (timeout =24 *(60 *60 ),key_prefix ='index_page')
def index_page ():
    O0000OO0OO0O0O0O0 =sys_cache ()
    O0O00OOOO00OOO000 =TL_Column_model .query .order_by (TL_Column_model .column_order .desc ()).order_by (TL_Column_model .id .asc ()).filter (TL_Column_model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    OOO0O0OOO0OO0O0OO =TL_Content_Model .query .order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .is_roll ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    O0O0OO0O000O000O0 =TL_Content_Model .query .order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .is_roll_text ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    OO0000O0000000OOO =TL_Content_Model .query .order_by (TL_Content_Model .is_index_stick .desc ()).order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ())
    O0000OO000000O0O0 ,OO000O0OO0OO0OO00 =page_auto (OO0000O0000000OOO ,20 ,4 )
    O00000000O0000OOO =TL_Content_Model .query .filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).count ()
    OO0OOO0O00000O0O0 =random .sample (TL_Content_Model .query .filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).all (),20 if O00000000O0000OOO >=20 else O00000000O0000OOO )
    O0OO0OO00OO00O00O =TL_Blogroll_Model .query .order_by (TL_Blogroll_Model .link_sort .desc ()).filter (TL_Blogroll_Model .status ==1 ,TL_Blogroll_Model .link_end_date >=datetime .now ()).all ()
    OO0O0OO00O00O000O =TL_Content_Model .query .order_by (TL_Content_Model .clicks .desc ()).filter (TL_Content_Model .update_time <datetime .now ()).all ()[0 :50 ]
    OOOOO0OOO0O00OOOO =TL_Notice_Model .query .order_by (TL_Notice_Model .id .desc ()).filter (TL_Notice_Model .status ==1 ).all ()
    O00O0OO000OO000O0 =TL_Content_Model .query .order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .is_recommend ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    O0OO0O0OO00000OO0 =TL_Tags_Model .query .all ()
    O0000OO000000O0O0 ={'system':O0000OO0OO0O0O0O0 ,'column':nav_list (O0O00OOOO00OOO000 ),'lantern':content (OOO0O0OOO0OO0O0OO [:50 ],'%Y-%m-%d'),'roll':content (O0O0OO0O000O000O0 [:50 ],'%Y-%m-%d'),'topNew':{'data':content (O0000OO000000O0O0 ,'%Y-%m-%d'),'page':OO000O0OO0OO0OO00 },'ran_doc':content (OO0OOO0O00000O0O0 ,'%Y-%m-%d'),'blogroll':O0OO0OO00OO00O00O ,'click_doc':content (OO0O0OO00O00O000O ,'%Y-%m-%d'),'notice':OOOOO0OOO0O00OOOO ,'con_rec':content (O00O0OO000OO000O0 [:50 ],'%Y-%m-%d'),'tags':O0OO0O0OO00000OO0 }
    return render_theme ('index.html',tlcms =O0000OO000000O0O0 )
@webapp_bp .route ('/list_article/<cid>',endpoint ='list_article_page',methods =['GET'])
@Authority
@ipAdd
@visiting_user
@cache .cache_with_param ()
def list_article_page (cid ):
    OOOO0000OOO00OOO0 =TL_Column_model .query .filter_by (uuid =cid ).first ()
    if not check_obj (OOOO0000OOO00OOO0 ):pass
    O0O00OO0OO0O0O000 =sys_cache ()
    OOOO0O0000O0OOO0O =TL_Column_model .query .order_by (TL_Column_model .column_order .desc ()).order_by (TL_Column_model .id .asc ()).filter (TL_Column_model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    O000OOOOO000OOOOO =TL_Content_Model .query .order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .is_roll ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    OOOOO00O0OO00O0O0 =TL_Content_Model .query .filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).count ()
    OOOOO0OO000OOO0O0 =random .sample (TL_Content_Model .query .filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).all (),20 if OOOOO00O0OO00O0O0 >=20 else OOOOO00O0OO00O0O0 )
    OOOOOO0OO0O0O00O0 =TL_Content_Model .query .order_by (TL_Content_Model .clicks .desc ()).filter (TL_Content_Model .update_time <datetime .now ()).all ()[0 :50 ]
    OOO0O00O0000OOOOO =TL_Notice_Model .query .order_by (TL_Notice_Model .id .desc ()).filter (TL_Notice_Model .status ==1 ).all ()
    OOO00OOO0O00O00O0 =TL_Content_Model .query .order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .is_recommend ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    O000OOOO000OO0OO0 =TL_Content_Model .query .order_by (TL_Content_Model .is_list_stick .desc ()).order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .superior ==OOOO0000OOO00OOO0 .id )
    OO00OO0OOO000O000 ,O00O0000O00OO0OO0 =page_auto (O000OOOO000OO0OO0 ,10 )
    O00000O0000O0OOO0 ={'cid':OOOO0000OOO00OOO0 .uuid ,'columnName':OOOO0000OOO00OOO0 .column_name ,'column_find':TL_Column_model .query .filter (TL_Column_model .column_parent_id ==OOOO0000OOO00OOO0 .id ).all (),'columnKey':OOOO0000OOO00OOO0 .column_keyword ,'columnDescription':OOOO0000OOO00OOO0 .column_description ,'page':{"total":O00O0000O00OO0OO0 .total ,"prev":O00O0000O00OO0OO0 .has_prev ,"prevPage":notNull (O00O0000O00OO0OO0 .prev_num ),"next":O00O0000O00OO0OO0 .has_next ,'nextPage':notNull (O00O0000O00OO0OO0 .next_num ),'currentPage':O00O0000O00OO0OO0 .page ,'pages':O00O0000O00OO0OO0 .pages ,'iter_pages':[O00O0O0OOO00OO0OO for O00O0O0OOO00OO0OO in O00O0000O00OO0OO0 .iter_pages (2 ,2 ,2 ,2 )if O00O0O0OOO00OO0OO ]},'dataList':content (OO00OO0OOO000O000 ,'%Y-%m-%d')}
    O00OOOO000OO0OO00 =TL_Content_Model .query .order_by (TL_Content_Model .is_index_stick .desc ()).order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ())
    O0OOO0OO0OOO0O0OO ,O00O0000O00OO0OO0 =page_auto (O00OOOO000OO0OO00 ,20 ,4 )
    OOOOO0OO0000000O0 =TL_Tags_Model .query .all ()
    OO00OOOO0000000O0 ={'system':O0O00OO0OO0O0O000 ,'column':nav_list (OOOO0O0000O0OOO0O ),'lantern':content (O000OOOOO000OOOOO [:50 ],'%Y-%m-%d'),'ran_doc':content (OOOOO0OO000OOO0O0 ,'%Y-%m-%d'),'click_doc':content (OOOOOO0OO0O0O00O0 ,'%Y-%m-%d'),'notice':OOO0O00O0000OOOOO ,'con_rec':content (OOO00OOO0O00O00O0 [:50 ],'%Y-%m-%d'),'col_doc':O00000O0000O0OOO0 ,'topNew':{'data':content (O0OOO0OO0OOO0O0OO ,'%Y-%m-%d'),'page':O00O0000O00OO0OO0 },'tags':OOOOO0OO0000000O0 }
    return render_theme ('list_article.html',tlcms =OO00OOOO0000000O0 )
@webapp_bp .route ('/article_page/<uid>',endpoint ='article_page',methods =['GET'])
@Authority
@ipAdd
@visiting_user
@cache.memoize (make_name ='article_page')
def article_page (uid):
    O000O00OOOO00OO00 =sys_cache ()
    OO0O0OOO0OOO00O0O =TL_Column_model .query .order_by (TL_Column_model .column_order .desc ()).order_by (TL_Column_model .id .asc ()).filter (TL_Column_model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    O00O0OOO00O0OO0OO =TL_Content_Model .query .order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .is_roll ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    OO0O000O00O0O00O0 =TL_Content_Model .query .filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).count ()
    OOO0OO0O000O0OO00 =random .sample (TL_Content_Model .query .filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).all (),20 if OO0O000O00O0O00O0 >=20 else OO0O000O00O0O00O0 )
    O00O0OO0000OO0O00 =TL_Content_Model .query .order_by (TL_Content_Model .clicks .desc ()).filter (TL_Content_Model .update_time <datetime .now ()).all ()[0 :50 ]
    OO0OOOO0OO000OOO0 =TL_Notice_Model .query .order_by (TL_Notice_Model .id .desc ()).filter (TL_Notice_Model .status ==1 ).all ()
    O00O0OOOOOOOOOOO0 =TL_Content_Model .query .order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .is_recommend ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    OO00OOOO000OOO000 =TL_Content_Model .query .filter_by (uuid =uid ,status =1 ).first ()
    if not check_obj (OO00OOOO000OOO000 ):pass
    OOOOOOOOOO0O0O0OO =OO00OOOO000OOO000 .pro .content_model
    O00O0000O0O000OO0 =2 if len (OOOOOOOOOO0O0O0OO )>=2 else len (OOOOOOOOOO0O0O0OO )
    OOOOOOO0OOOO00OO0 =random .sample (OOOOOOOOOO0O0O0OO ,O00O0000O0O000OO0 )
    if len (OOOOOOO0OOOO00OO0 )==2 :
        OOOOOOOOO00OOO000 ={"title":OOOOOOO0OOOO00OO0 [0 ].title ,"ID":OOOOOOO0OOOO00OO0 [0 ].uuid ,'imgUrl':img (OOOOOOO0OOOO00OO0 [0 ].thumb_img ,OOOOOOO0OOOO00OO0 [0 ].content ),}
        OO000O0O00OO00O00 ={"title":OOOOOOO0OOOO00OO0 [1 ].title ,"ID":OOOOOOO0OOOO00OO0 [1 ].uuid ,'imgUrl':img (OOOOOOO0OOOO00OO0 [1 ].thumb_img ,OOOOOOO0OOOO00OO0 [1 ].content ),}
    elif len (OOOOOOO0OOOO00OO0 )==1 :
        OOOOOOOOO00OOO000 ={"title":OOOOOOO0OOOO00OO0 [0 ].title ,"ID":OOOOOOO0OOOO00OO0 [0 ].uuid ,'imgUrl':img (OOOOOOO0OOOO00OO0 [0 ].thumb_img ,OOOOOOO0OOOO00OO0 [0 ].content ),}
        OO000O0O00OO00O00 ={"title":'',"ID":'','imgUrl':'',}
    else :
        OOOOOOOOO00OOO000 ={"title":'',"ID":'','imgUrl':''}
        OO000O0O00OO00O00 ={"title":'',"ID":'','imgUrl':''}
    OO0OOO0OO00OOO000 ={"similar":content (OO00OOOO000OOO000 .pro .content_model [:20 ][::-1 ],'%Y-%m-%d'),"data":{"title":OO00OOOO000OOO000 .title ,'ID':OO00OOOO000OOO000 .uuid ,'update_time':OO00OOOO000OOO000 .update_time .strftime ('%Y-%m-%d'),'title_color':OO00OOOO000OOO000 .title_color ,'imgUrl':img (OO00OOOO000OOO000 .thumb_img ,OO00OOOO000OOO000 .content ),'PID':OO00OOOO000OOO000 .pro .column_name ,'PID_Id':OO00OOOO000OOO000 .pro .uuid ,'author':OO00OOOO000OOO000 .author ,'clicks':OO00OOOO000OOO000 .clicks ,'contributor':OO00OOOO000OOO000 .contributor ,'description':OO00OOOO000OOO000 .description ,'content':OO00OOOO000OOO000 .content ,'permissions':OO00OOOO000OOO000 .permissions ,'download':OO00OOOO000OOO000 .download ,'keyword':[O000O0O000OOO000O for O000O0O000OOO000O in OO00OOOO000OOO000 .keyword .split (',')if O000O0O000OOO000O .strip ()],'is_focus':OO00OOOO000OOO000 .is_focus ,'is_roll':OO00OOOO000OOO000 .is_roll ,'is_roll_text':OO00OOOO000OOO000 .is_roll_text ,'is_index_stick':OO00OOOO000OOO000 .is_index_stick ,'is_list_stick':OO00OOOO000OOO000 .is_list_stick ,'pay':OO00OOOO000OOO000 .reward ,},"commentList":[{"comment_txt":O0O0OO00000OO0O00 .comment_txt ,"user_qq":O0O0OO00000OO0O00 .user_qq ,"user_name":O0O0OO00000OO0O00 .user_name ,"create_time":O0O0OO00000OO0O00 .create_time .strftime ('%Y-%m-%d'),}for O0O0OO00000OO0O00 in (OO00OOOO000OOO000 .comment_model [:100 ])[::-1 ]if O0O0OO00000OO0O00 .status ],'comment_total':len (OO00OOOO000OOO000 .comment_model ),"next_page":OOOOOOOOO00OOO000 ,"last_page":OO000O0O00OO00O00 ,}
    OOOO000OO0000OOOO =TL_Content_Model .query .order_by (TL_Content_Model .is_index_stick .desc ()).order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ())
    O0000OOO0OOOOO0O0 ,OOOOOOO0OOOO00OO0 =page_auto (OOOO000OO0000OOOO ,20 ,4 )
    OO00OO0OO0OOOOO0O =TL_Tags_Model .query .all ()
    O00O0O0000OO0OOO0 ={'system':O000O00OOOO00OO00 ,'column':nav_list (OO0O0OOO0OOO00O0O ),'lantern':content (O00O0OOO00O0OO0OO [:50 ],'%Y-%m-%d'),'ran_doc':content (OOO0OO0O000O0OO00 ,'%Y-%m-%d'),'click_doc':content (O00O0OO0000OO0O00 ,'%Y-%m-%d'),'notice':OO0OOOO0OO000OOO0 ,'con_rec':content (O00O0OOOOOOOOOOO0 [:50 ],'%Y-%m-%d'),'content_data':OO0OOO0OO00OOO000 ,'topNew':{'data':content (O0000OOO0OOOOO0O0 ,'%Y-%m-%d'),'page':OOOOOOO0OOOO00OO0 },'tags':OO00OO0OO0OOOOO0O }
    return render_theme ('article_article.html',tlcms =O00O0O0000OO0OOO0 )
@webapp_bp .errorhandler (404 )
def not_found_error (OO0OO00000O0OO00O ):
    return render_template ('error_template/error_400.html'),200
@webapp_bp .route ('/search',endpoint ='search',methods =['GET'])
@Authority
@ipAdd
@visiting_user
@cache .cache_with_param ()
def search ():
    OOO0OO000O0OOO00O =request .args .get ('keywords','')
    O00O0O00O000000OO =sys_cache ()
    OOO00O0OO0OOO000O =TL_Column_model .query .order_by (TL_Column_model .column_order .desc ()).order_by (TL_Column_model .id .asc ()).filter (TL_Column_model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    O0O0OOOO000OO0OOO =TL_Content_Model .query .order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .is_roll ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    O00O00O0000O000OO =TL_Content_Model .query .filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).count ()
    OO0O00O000OO000OO =random .sample (TL_Content_Model .query .filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).all (),20 if O00O00O0000O000OO >=20 else O00O00O0000O000OO )
    OO000O000OOO0OOO0 =TL_Content_Model .query .order_by (TL_Content_Model .clicks .desc ()).filter (TL_Content_Model .update_time <datetime .now ()).all ()[0 :50 ]
    OOOOO00OO0OOO0OOO =TL_Notice_Model .query .order_by (TL_Notice_Model .id .desc ()).filter (TL_Notice_Model .status ==1 ).all ()
    O0OOOOO0O000O0OO0 =TL_Content_Model .query .order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .is_recommend ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    OO0O0O0000O0OOO0O =TL_Content_Model .query .order_by (TL_Content_Model .is_list_stick .desc ()).order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .title .like (f"%{OOO0OO000O0OOO00O}%"))
    O00OO00OOOO0O000O ,O00000OOO00000O0O =page_auto (OO0O0O0000O0OOO0O ,10 ,)
    O00OOOO0O00OO0000 ={'search':OOO0OO000O0OOO00O ,'page':{"total":O00000OOO00000O0O .total ,"prev":O00000OOO00000O0O .has_prev ,"prevPage":notNull (O00000OOO00000O0O .prev_num ),"next":O00000OOO00000O0O .has_next ,'nextPage':notNull (O00000OOO00000O0O .next_num ),'currentPage':O00000OOO00000O0O .page ,'pages':O00000OOO00000O0O .pages ,'iter_pages':[OO00OOOOO00OOO0O0 for OO00OOOOO00OOO0O0 in O00000OOO00000O0O .iter_pages (2 ,2 ,2 ,2 )if OO00OOOOO00OOO0O0 ]},'dataList':content (O00OO00OOOO0O000O ,'%Y-%m-%d')}
    O0O00O00OO0O00O0O =TL_Content_Model .query .order_by (TL_Content_Model .is_index_stick .desc ()).order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ())
    O000O0O0O000OO0O0 ,O00000OOO00000O0O =page_auto (O0O00O00OO0O00O0O ,20 ,4 )
    OO000O0OO0O00OOO0 =TL_Tags_Model .query .all ()
    O0OOOOO00O0OOOOOO ={'system':O00O0O00O000000OO ,'column':nav_list (OOO00O0OO0OOO000O ),'lantern':content (O0O0OOOO000OO0OOO [:50 ],'%Y-%m-%d'),'ran_doc':content (OO0O00O000OO000OO ,'%Y-%m-%d'),'click_doc':content (OO000O000OOO0OOO0 ,'%Y-%m-%d'),'notice':OOOOO00OO0OOO0OOO ,'con_rec':content (O0OOOOO0O000O0OO0 [:50 ],'%Y-%m-%d'),'search':O00OOOO0O00OO0000 ,'topNew':{'data':content (O000O0O0O000OO0O0 ,'%Y-%m-%d'),'page':O00000OOO00000O0O },'tags':OO000O0OO0O00OOO0 }
    return render_theme ('search_article.html',tlcms =O0OOOOO00O0OOOOOO )
@webapp_bp .route ('/tag/<string:tag>',endpoint ='tag_page',methods =['GET'])
@Authority
@ipAdd
@cache .cache_with_param ()
def tagIndex (tag):
    OO0OO00O0O0OOOO0O =sys_cache ()
    OOOOOO00OOOOO0OOO =TL_Column_model .query .order_by (TL_Column_model .column_order .desc ()).order_by (TL_Column_model .id .asc ()).filter (TL_Column_model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    O0OO0O0O0OO000O0O =TL_Content_Model .query .order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .is_roll ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    O0OOO00O0OOO0O0OO =TL_Content_Model .query .filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).count ()
    OOOOOOO0OOOOOO0O0 =random .sample (TL_Content_Model .query .filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ()).all (),20 if O0OOO00O0OOO0O0OO >=20 else O0OOO00O0OOO0O0OO )
    OOOOO0OOO00OOO0OO =TL_Content_Model .query .order_by (TL_Content_Model .clicks .desc ()).filter (TL_Content_Model .update_time <datetime .now ()).all ()[0 :50 ]
    OO0O0000O00O0OOO0 =TL_Notice_Model .query .order_by (TL_Notice_Model .id .desc ()).filter (TL_Notice_Model .status ==1 ).all ()
    OO0000OO0OOOOOO0O =TL_Content_Model .query .order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .is_recommend ==1 ,TL_Content_Model .update_time <datetime .now ()).all ()
    O0O0O0OOOOO00OOOO =TL_Content_Model .query .order_by (TL_Content_Model .is_list_stick .desc ()).order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .title .like (f"%{tag}%"))
    OOOO00O00O000OOO0 ,OOOO0O000O000OO00 =page_auto (O0O0O0OOOOO00OOOO ,10 ,)
    O00000000OOO00O00 ={'tag':tag ,'page':{"total":OOOO0O000O000OO00 .total ,"prev":OOOO0O000O000OO00 .has_prev ,"prevPage":notNull (OOOO0O000O000OO00 .prev_num ),"next":OOOO0O000O000OO00 .has_next ,'nextPage':notNull (OOOO0O000O000OO00 .next_num ),'currentPage':OOOO0O000O000OO00 .page ,'pages':OOOO0O000O000OO00 .pages ,'iter_pages':[O0OOO0O0OO0O0O0OO for O0OOO0O0OO0O0O0OO in OOOO0O000O000OO00 .iter_pages (2 ,2 ,2 ,2 )if O0OOO0O0OO0O0O0OO ]},'dataList':content (OOOO00O00O000OOO0 ,'%Y-%m-%d')}
    O00O0OOOO0000O000 =TL_Content_Model .query .order_by (TL_Content_Model .is_index_stick .desc ()).order_by (TL_Content_Model .id .desc ()).filter (TL_Content_Model .status ==1 ,TL_Content_Model .update_time <datetime .now ())
    O00OOO0O00OOOOOOO ,OOOO0O000O000OO00 =page_auto (O00O0OOOO0000O000 ,20 ,4 )
    O0O00O0OOO0OOO000 =TL_Tags_Model .query .all ()
    O0O0OOO0O0OOO0OO0 ={'system':OO0OO00O0O0OOOO0O ,'column':nav_list (OOOOOO00OOOOO0OOO ),'lantern':content (O0OO0O0O0OO000O0O [:50 ],'%Y-%m-%d'),'ran_doc':content (OOOOOOO0OOOOOO0O0 ,'%Y-%m-%d'),'click_doc':content (OOOOO0OOO00OOO0OO ,'%Y-%m-%d'),'notice':OO0O0000O00O0OOO0 ,'con_rec':content (OO0000OO0OOOOOO0O [:50 ],'%Y-%m-%d'),'tag':O00000000OOO00O00 ,'topNew':{'data':content (O00OOO0O00OOOOOOO ,'%Y-%m-%d'),'page':OOOO0O000O000OO00 },'tags':O0O00O0OOO0OOO000 }
    return render_theme ('tags_article.html',tlcms =O0O0OOO0O0OOO0OO0 )
